#include <47func.h>
//子进程的状态
enum {
    FREE,
    BUSY
};
// 父进程需要保存每个子进程的信息
typedef struct workerdata_s{
    pid_t pid;
    int status;//FREE or BUSY
    int pipefd;//子进程的socketpair的fd
} workerdata_t;
typedef struct train_s {
    int length;
    char data[1000];//上限是1000个字节
}train_t;
int makeWorker(workerdata_t *workerdataArr, int workerNum);
int eventLoop(int pipefd);
int tcpInit(const char *ip, const char *port, int *psockfd);
int sendfd(int pipefd, int fdtosend);
int recvfd(int pipefd, int *pfdtorecv);
int epollDel(int epfd, int fd);
int epollAdd(int epfd, int fd);
int transFile(int netfd);
